package com.lam.fundamental;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

public class TextViewColorActivity extends Activity{

	
	private LinearLayout myLayout;
	private LinearLayout.LayoutParams layoutParams;
	private int wc = LinearLayout.LayoutParams.WRAP_CONTENT;
	private TextView black_TV,blue_TV;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.textviewshowinfo);
		myLayout = new LinearLayout(this);
		myLayout.setOrientation(LinearLayout.VERTICAL);
		myLayout.setBackgroundResource(R.drawable.ic_launcher);
		setContentView(myLayout);
		layoutParams = new LinearLayout.LayoutParams(wc, wc);
		constructTextView();	
		addTextView();
		setTextViewColor();
		setTextViewText();
	}
	

	 private void setTextViewText() {
		// TODO Auto-generated method stub
		black_TV.setText("Black");
		blue_TV.setText("Blue");
	}



	private void setTextViewColor() {
		// TODO Auto-generated method stub
		black_TV.setTextColor(Color.BLACK);
		blue_TV.setTextColor(Color.BLUE);
	}



	private void addTextView() {
		// TODO Auto-generated method stub
		myLayout.addView(black_TV,layoutParams);
		myLayout.addView(blue_TV,layoutParams);
	}



	private void constructTextView() {
		// TODO Auto-generated method stub
		black_TV  = new TextView(this);
		blue_TV = new TextView(this);
	}

	

	
}
